Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System Test: Module (WAZUH-DB) - Agent never_connected connects - default group #2665

Merged
merged 19 commits into from
Mar 15, 2022

Conversation

CamiRomero
Copy link
Contributor

In this PR the test suite for Agent never_connected connects is added. A total of 2 new test cases covering different modes and combinations of options.

Related issues #2508 #10771

Cases:

  • Agent never_connected connects - default group:
    - The agent on active status and connect to master node has the default group
    - The agent on active status and connect to worker node has the default group

Configuration options

In order to run the test, first the environment located in /test/system/provisioning/enrollment_cluster must be enabled with:
sudo ansible-playbook -i inventory.yml playbook.yml --extra-vars='{"wazuh_branch": "dev-10771-agent-groups-files-to-wazuh-db"}'

Local Internal Options: No Local Internal Options used



Tests Results

Test Path Os/Type Execution Type Results Date By
test/system/test_cluster/test_agent_groups/test_agent_groups_default.py CentOS - Manager Local 🟢🟢🟢 10/03/2022 @CamiRomero

Required

  • Proven that tests pass when they have to pass.
  • Proven that tests fail when they have to fail.
  • Python codebase satisfies PEP-8 style style guide. pycodestyle --max-line-length=120 --show-source --show-pep8 file.py.
  • Python codebase is documented following the Google Style for Python docstrings.
  • The test is documented in wazuh-qa/docs.

@Deblintrake09
Copy link
Contributor

Deblintrake09 commented Mar 14, 2022

Tests Results

Test Path Os/Type Execution Type Results Date By
test/system/test_cluster/test_agent_groups/test_agent_groups_default.py CentOS - Manager Local 🟢🟢🟢 14/03/2022 @Deblintrake09

@damarisg damarisg linked an issue Mar 15, 2022 that may be closed by this pull request
@pytest.mark.parametrize("test_infra_managers",[test_infra_managers])
@pytest.mark.parametrize("test_infra_agents",[test_infra_agents])
@pytest.mark.parametrize("host_manager",[host_manager])
@pytest.mark.parametrize("agent_target", test_infra_managers)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is agent_target not a list and contains test_infra_manager?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parametrize requires a list of values, and test_infra_managers is a list of all manager hosts, so it is passed that way, not inside a list.

@pytest.mark.parametrize("test_infra_agents",[test_infra_agents])
@pytest.mark.parametrize("host_manager",[host_manager])
@pytest.mark.parametrize("agent_target", test_infra_managers)
def test_agent_default_group(agent_target, clean_environment, test_infra_managers, test_infra_agents, host_manager):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the module name and the path with the new module name. Ex: test_agent_added_the_default_group.

Also, when you change it, you should change the path in the documentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed name to test_agent_default_group_added.
Did not add to path in documentation since it was removed as requested

@Deblintrake09
Copy link
Contributor

Deblintrake09 commented Mar 15, 2022

Tests Results

Test Path Os/Type Execution Type Results Date By
test/system/test_cluster/test_agent_groups/test_agent_groups_default.py CentOS - Manager Local 🟢 15/03/2022 @Deblintrake09

@damarisg damarisg merged commit ff7a935 into system_test_wazuh_db Mar 15, 2022
@damarisg damarisg deleted the tmp-2505-test-agent-groups-default branch March 15, 2022 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System Test - Wazuh DB (T0): Agent never_connected connects
3 participants